package com.example.blog.service;

import com.example.blog.mapper.BlogMapper;
import com.example.blog.model.BlogInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName: BlogService
 * Package: IntelliJ IDEA
 * Description:
 *
 * @Author 谷京京
 * @Create 2024/3/26 10:31
 * @Version 1.0
 */
@Service
public class BlogService {
    @Autowired
    private BlogMapper blogMapper;
    public List<BlogInfo> setBlogList() {
        return blogMapper.queryBlogList();
    }

    public BlogInfo getBlogDetail(Integer id) {
        return blogMapper.queryById(id);
    }

    public Integer insertBlog(BlogInfo blog) {
        return blogMapper.insertBlog(blog);
    }

    public Integer updateBlog(BlogInfo blogInfo) {
        return blogMapper.update(blogInfo);
    }

    public Integer delete(Integer id) {
        return blogMapper.delete(id);
    }
}
